#include <cppunit/extensions/HelperMacros.h>

#include "FakeTests.h"
#include "NotImplementedException.h"
#include "WhenCalled.h"

CPPUNIT_TEST_SUITE_REGISTRATION(FakeTests::When_spawned);
CPPUNIT_TEST_SUITE_REGISTRATION(FakeTests::When_defining_behavior);

void FakeTests::When_spawned::Assure_calling_abstract_method_throws_exception()
{
    CPPUNIT_ASSERT_THROW(_testClass->voidMethodWithNoArguments(), NotImplementedException);
}

void FakeTests::When_defining_behavior::Assure_allowing_void_method_with_no_arguments()
{
    WhenCalled<ITestClass> whenCalled =
        _testClass.whenCalled(&ITestClass::voidMethodWithNoArguments);
}

void FakeTests::When_defining_behavior::Assure_allowing_void_method_with_one_arguments()
{
    WhenCalledArg<ITestClass, int> whenCalled =
        _testClass.whenCalled(&ITestClass::voidMethodWithOneArgument);
}

void FakeTests::When_defining_behavior::Assure_allowing_void_method_with_two_arguments()
{
    WhenCalledArgs2<ITestClass, int, int> whenCalled =
        _testClass.whenCalled(&ITestClass::voidMethodWithTwoArguments);
}

void FakeTests::When_defining_behavior::Assure_allowing_void_method_with_three_arguments()
{
    WhenCalledArgs3<ITestClass, int, int, int> whenCalled =
        _testClass.whenCalled(&ITestClass::voidMethodWithThreeArguments);
}

void FakeTests::When_defining_behavior::Assure_allowing_void_method_with_four_arguments()
{
    WhenCalledArgs4<ITestClass, int, int, int, int> whenCalled =
        _testClass.whenCalled(&ITestClass::voidMethodWithFourArguments);
}

void FakeTests::When_defining_behavior::Assure_allowing_non_void_method_with_no_arguments()
{
    WhenCalledReturn<ITestClass, int> whenCalled =
        _testClass.whenCalled(&ITestClass::nonVoidMethodWithNoArguments);
}

void FakeTests::When_defining_behavior::Assure_allowing_non_void_method_with_one_arguments()
{
    WhenCalledReturnArg<ITestClass, int, int> whenCalled =
        _testClass.whenCalled(&ITestClass::nonVoidMethodWithOneArgument);
}

void FakeTests::When_defining_behavior::Assure_allowing_non_void_method_with_two_arguments()
{
    WhenCalledReturnArgs2<ITestClass, int, int, int> whenCalled =
        _testClass.whenCalled(&ITestClass::nonVoidMethodWithTwoArguments);
}

void FakeTests::When_defining_behavior::Assure_allowing_non_void_method_with_three_arguments()
{
    WhenCalledReturnArgs3<ITestClass, int, int, int, int> whenCalled =
        _testClass.whenCalled(&ITestClass::nonVoidMethodWithThreeArguments);
}

void FakeTests::When_defining_behavior::Assure_allowing_non_void_method_with_four_arguments()
{
    WhenCalledReturnArgs4<ITestClass, int, int, int, int, int> whenCalled =
        _testClass.whenCalled(&ITestClass::nonVoidMethodWithFourArguments);
}
